import java.util.LinkedList;

/*
 * Josh Lindoo
 * Login ID : lind6441
 * CS-102, Winter 2013
 * Programming Assignment 3
 * Movie class: Information about a movie
 */

public class Movie {
	
	//Fields
	private int numericalID = 0; //unique ID of movie
	private int runTime = 0; //length of movie
	private String title = null; //title of movie
	private String rating = null; //rating of movie
	private LinkedList <Showing>showList = new LinkedList<Showing>(); //shows
	
	//Constructor
	public Movie (String[] movieData) {
		
		//store parameters in respective fields
		this.numericalID = Integer.parseInt(movieData[0]); 	//parse ID as int 
		this.title = movieData[1]; //save title
		this.runTime = Integer.parseInt(movieData[2]); //parse runtime as int
		this.rating = movieData[3]; //save rating
		
	}
	
	/*
	 * Methods: getID, getTitle, getShowList
	 * Purpose: Accessor methods for the unique ID, title, and showList fields
	 * Parameters:
	 * getID Returns: int		unique ID of movie
	 * getTitle Returns: str	title of movie
	 */
	
	public int getID() {
		return numericalID;
	}
	
	public String getTitle() {
		return title;
	}
	
	public LinkedList getShowList() {
		return showList;
	}
	
	/*
	 * Method: toString
	 * Purpose: Return movie data in string format
	 * Parameters:
	 * Returns: str		Readable movie data
	 */
	
	public String toString() {
		return title + " (" + rating + ", " + runTime +")"; 
	}

}
